package isquirrel.beans;

public class Url {
	
	private Long id;
	private String title;
	private String address;
	private boolean liked;
	private Integer recommended;
	private String thumb;
	private String source; //static, dynamic, friends, network etc (to be converted to an enum later on)
	
	public Url() {
		this.liked = false;
		this.recommended = 0;
	}
	
	public Url(String title, String address) {
		super();
		this.title = title;
		this.address = address;
		this.liked = false;
		this.recommended = 0;
	}
	
	public Url(String title, String address, String source) {
		this.title = title;
		this.address = address;
		this.source = source;
		this.liked = false;
		this.recommended = 0;
	}
	
	
	public Long getId() {
		return id;
	}
	@SuppressWarnings("unused")
	private void setId(Long id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public boolean isLiked() {
		return liked;
	}
	public void setLiked(boolean liked) {
		this.liked = liked;
	}
	public Integer getRecommended() {
		return this.recommended;
	}
	public void setRecommended(Integer recommended) {
		this.recommended = recommended;
	}
	
	public String getThumb(){
		return this.thumb;
	}
	
	public void setThumb(String thumb){
		this.thumb = thumb;
	}
	
	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}

	
	@Override
	public boolean equals(Object other){
		if (other instanceof Url) {
			return this.address.equals(((Url) other).getAddress());
		}
		return false;
	}
	
	@Override
	public int hashCode() {
		return this.address.hashCode();
	}
	public String toString() {
		return this.getAddress();
	}

}
